
<template>
  <div>
    <van-nav-bar
      title="21天战痘计划"
      left-text="返回"
      left-arrow
      @click="onClickLeft"
    />

    <div class="pimple">
      <div class="pim-img">
        <img src="../../assets/img/养成4.png" alt="" />
      </div>

      <van-tabs v-model:active="active">
        <van-tab title="介绍">
          <div class="pim">
            <div class="pim-box">
              <div class="pim-left"><span>.</span>难度系数:</div>
              <div class="pim-right">
                <van-icon name="star" class="star" />
                <van-icon name="star" class="star"/>
              </div>
            </div>

            <div class="pim-box">
              <div class="pim-left"><span>.</span>适用人群:</div>
              <div class="pim-right">青春期，上班族</div>
            </div>

            <div class="pim-box">
              <div class="pim-left"><span>.</span>预期效果:</div>
              <div class="pim-right">减轻痘痘症状</div>
            </div>

            <div class="pim-text">
              <div class="pim-text-title">
                痘痘长哪儿最不让人担心？腰上还是别人脸上？
              </div>
              <div class="pim-text-title">
                废话，如果能不长，谁会要那种东西！所以我们来聊一下怎么祛痘。痘痘的成因非常多，不一定是因为吃太油，或者脸没洗干净，本计划主要针对青春期，由于雄性激素分泌过多导致的痘痘，同时对于成年后由于不良习惯和压力带来的痘痘有一定效果。
              </div>
              <div class="pim-text-title">
                其实祛痘并没有什么神奇的方法，也不存在什么偏方，通过每天坚持下来的小习惯，可以改善皮肤状况，调节内分泌和激素水平，帮助缓解痘痘症状。
              </div>
              <div class="text-te"></div>
              <div class="pim-text-title">
                特别说明：本方案适合轻度痤疮用户，如果你的痤疮（痘痘）症状非常严重，建议咨询医生，确定成因后配合药物进行针对性治疗。
              </div>
            </div>
          </div>
        </van-tab>
        <van-tab title="目标">内容 2</van-tab>
      </van-tabs>
    </div>
       <div class="cult-btn">
      <div class="button"  v-if="flag==false" @click="addji">加入计划</div>
      <div class="but"  v-else>
       <span class="look">查看今天任务</span>
       <span class="cancel" @click="handiefalse">取消计划</span>
      </div>
    </div>
  </div>
</template>

<script setup lang='ts'>
import { ref } from 'vue'

const active = ref(0)

const onClickLeft = () => history.back()
const flag=ref(false);
const addji=()=>{

  flag.value=true;
  console.log('加入计划');
  localStorage.setItem('flag',JSON.stringify(flag.value));

}
const handiefalse=()=>{
  flag.value=false;


}
</script>




<style lang="scss" scoped>
.pimple {
  width: 100%;
  height: 100%;
  // background-color: yellow;
  .pim-img {
    width: 100%;
    height: 150px;
    img {
      width: 100%;
      height: 100%;
    }
  }

  .pim {
    .pim-box {
      width: 100%;
      height: 50px;
    }

    .pim-left {
      float: left;
      height: 40px;
      width: 30%;
      // background-color: blue;
      text-align: center;
      padding-top: 10px;

        span{
        color: #39d167;

      }
    }
    .pim-right {
      float: left;
      height: 40px;
      width: 70%;
      // background-color: rgb(24, 148, 96);
      text-align: left;
      padding-top: 10px;
      .star{
        color: #ffa800;
      }
    }

    .pim-text {
      width: 100%;
      padding: 10px;
      // line-height: 30px;
      // background-color: pink;
      color: #666;

      .pim-text-title {
        line-height: 30px;
      }
      .text-te {
        color: red;
        font-weight: bold;
      }
    }
  }
}
.cult-btn {
  position:fixed;
  width: 100%;
  height: 90px;
  // text-align: center;
  padding: 10px;
  background-color: #fff;
  bottom: 0;
  .button {
    width: 100%;
    height: 45px;
    background-color: #39d167;
    text-align: center;
    line-height: 45px;
    color: white;
    font-weight: 550;
    font-size: 18px;
    opacity: 1;
  }
  .but{
      width: 100%;
    height: 45px;


    line-height: 45px;
    color: white;
    font-weight: 550;
    font-size: 18px;
  // opacity: 0;
   display: flex;

   .look{
    width: 180px;
    display: inline-block;
     background-color: #39d167;
     text-align: center;
   }
   .cancel{
    width: 180px;
    display: inline-block;
    border: 1px solid #39d167;
    color: #39d167;
    text-align: center;
    margin-left: 10px;

   }
  }
}
</style>
